<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * 问卷管理
 * @author Administrator
 *
 */
class Wj extends Admin_Controller{
	
	public function __construct(){
		parent::__construct();
	}
	
	public function count(){
		
		$this->load->library('Mongo_db_n');
		$answerList = $this->mongo_db_n->getAll('question');
		$res = array();
		foreach ( $answerList as $k=>$v){
			$countAll = 0;
			if ( !empty($v['answer']) && is_array($v['answer']) ){
				foreach ($v['answer'] as $kk=>$vv){
					$countAll += $vv['a_count'];
				} 
				$v['count_all'] = $countAll;
			}
			$res[$k]=$v;
		}
		$temp['list'] = $res;
		$this->showView('admin/wj/count',$temp);
	}
	
	
}